package com.simpleframe.flow;

public class MainTester {

	public static void main(String[] args) {
		//定义流程
		Process process = new Process("请假申请");
		StartStap start = new StartStap();
		Stap fill = new Stap("填写申请表格");
		Stap manager = new Stap("部门经理申批");
		Stap admin = new Stap("行政部申批");
		Stap gm = new Stap("总经理审批");
		EndStap end = new EndStap();
		
		Transition ft = new Transition(fill);//无表达式一定可以过去
		Transition mt = new Transition(manager);//无表达式一定可以过去
		
		Transition at = new Transition("date>2",admin);//无表达式一定可以过去
		
		Transition gt = new Transition("date>3",gm);//无表达式一定可以过去
		
		Transition mnt = new Transition("date<2",end);//无表达式一定可以过去
		Transition ant = new Transition("date<3",end);//无表达式一定可以过去
		
		Transition e = new Transition(end);
		
		start.addTransition(new Transition(fill));
		fill.addTransition(new Transition(manager));
		
		manager.addTransition(new Transition("date<=1",end));
		manager.addTransition(new Transition("date>=2",admin));
		
		admin.addTransition(new Transition("date<=2",end));
		admin.addTransition(new Transition("date>=2",gm));
		
		gm.addTransition(new Transition(end));
		
		//执行流程
		process.setStartStap(start);
		process.setEndStap(end);
		process.addNode(fill);
		process.addNode(manager);
		process.addNode(admin);
		process.addNode(gm);
		
		start.forword();
		
		
		
	}
}
